import HTTP from '../utils/http';
import { API } from '../config/config';
export default class ApiService extends HTTP{
    findEssay(data){
        return new Promise((resolve)=>{
            this.axiosPost({
                url:API.ESSAY_GET,
                data,
                success(data){
                    resolve(data.data)
                },error(error){
                   console.log('发生了错误');
                }
            })
          })  
    }
    findEssayType(data){
      console.log(data);
      return new Promise((resolve)=>{
          this.axiosPost({
              url:API.ESSAY_GET_TYPE,
              data,
              success(data){
                  resolve(data.data)
              },error(error){
                 console.log('发生了错误');
              }
          })
        })  
    }
    findFirendLink(id) {
        return new Promise((resolve)=>{
          this.axiosPost({
              url:API.FIREND_GET,
              data:id,
              success(data){
                  resolve(data.data)
              },error(error){
                console.log('发生了错误');
              }
          })
        })  
      }
      findProject(id) {
        return new Promise((resolve)=>{
          this.axiosPost({
              url:API.PROJECT_GET,
              data:id,
              success(data){

                  resolve(data.data)
              },error(error){
                console.log('发生了错误');
              }
          })
        })  
      }  
      findType(id) {
        return new Promise((resolve)=>{
          this.axiosPost({
              url:API.TYPE_GET,
              data:id,
              success(data){
                  
                  resolve(data.data)
              },error(error){
                console.log('发生了错误');
              }
          })
        })  
      }
}
